package csen;

public class CarFactory extends Factory {

	@Override
	protected Car createCar(String type, String brand, Color color,
			FuelType fuelType, int price) {
		if ("coupe".equals(type)) {
			return new Coupe(brand, color, price, fuelType);
		} else if ("sedan".equals(type)) {
			return new Sedan(brand, color, price, fuelType);
		} else if ("truck".equals(type)) {
			return new Truck(brand, color, price, fuelType);
		} else {
			throw new IllegalArgumentException(
					"type must be 'coupe', 'sedan' or 'truck'!");
		}
	}
}
